#ifndef SEGMENTMANAGER_H_INCLUDED
#define SEGMENTMANAGER_H_INCLUDED

#include "Segment.h"

class SegmentManager
{
public:
    SegmentManager(const SegmentManager& other) = delete;

    Segment& createSegment();
    void removeSegment(Segment& segment);
    ~SegmentManager();

protected:

private:
    SegmentManager(SegmentInventory& segInventory);

    unsigned nextSegmentId;
    SegmentInventory& segmentInventory;
    vector<Segment*> segments;
    SEMAPHORE semManager_lock;

    friend class DB;
};

#endif // SEGMENTMANAGER_H_INCLUDED
